﻿/*
openEco 0.000.1
ben howes  100611
 */
using System;
using System.Collections.Generic;
using System.Text;
//using System.Xml.Linq

namespace openEco
{
	public class Object : IOpenEco
	{
		//PRIVATE ATTRIBUTES
		
		//the list containing all of the objects (really all of the object indexes) in the model
		private List<String> myObjectList;
		
		//PUBLIC PROPERTIES
		
		//PUBLIC METHODS
		
		//create a wall object
		public void createWallObject(){
			string createMyWallObject = "add.object 7 12";
			myObjectList.Add(rq.Request(createMyWallObject, 1000));
		}
		
		//add nodes to object
		public void addNodeToObject( int objectIndex, int nodeIndex, double x, double y, double z){
			//string addMyNodeToObject = "add.node {0} {1} {2} {3} {4}", objectIndex, nodeIndex, x, y, z ;
			string addMyNodeToObject = "add.node " + objectIndex + " " + nodeIndex + " " + x + " " + y + " " + z;
			rq.Request(addMyNodeToObject, 1000);
		}
		
		//close out object
		public void objectDone(){
			string myObjectDone  = "object.done";
			cmd.Execute(myObjectDone, 1000);
				
		}
		
		public void declaremask(int masknum){
			string mask = "add.mask " + masknum;
			rq.Request(mask,1000);
		}

		public void addtomask(int masknum, int objectnum){
			string addmask = "set.masks.object " + masknum + "" + objectnum;
			cmd.Execute(addmask,1000);
		}
		
		public void group(){
			string groupselection = "selection.group";
			cmd.Execute(groupselection,1000);
		}
		
		public void scalemodel(int obje, int value){
			string scale = "object.scale " + obje + " " + value + " " + value + " " + value;
			cmd.Execute(scale,1000);
		}
		
		//CONSTRUCTORS
		
		//call the base constructor
		public Object(NDde.Client.DdeClient c, NDde.Client.DdeClient r) : base(c,r){
			
			//initialize the list
			myObjectList = new List<String>();
		}
	}
}
